namespace Microsoft.VisualStudio.EnterpriseTools.OperationDesigner
{
    using Microsoft.VisualStudio.VirtualTreeGrid;
    using System;

    public class ChildBranchInfo
    {
        private IBranch branch;
        private BranchModificationEventHandler childModificationHandler;
        private object id;
        private string name;

        public ChildBranchInfo(IBranch branch, string name, object id)
        {
            this.branch = branch;
            this.name = name;
            this.id = id;
        }

        public IBranch Branch
        {
            get
            {
                return this.branch;
            }
        }

        internal BranchModificationEventHandler ChildModificationHandler
        {
            get
            {
                return this.childModificationHandler;
            }
            set
            {
                if (this.childModificationHandler != null)
                {
                    this.branch.OnBranchModification -= this.childModificationHandler;
                }
                this.childModificationHandler = value;
                if (this.childModificationHandler != null)
                {
                    this.branch.OnBranchModification += this.childModificationHandler;
                }
            }
        }

        public object Id
        {
            get
            {
                return this.id;
            }
        }

        public string Name
        {
            get
            {
                return this.name;
            }
        }
    }
}

